#include <sys/utsname.h>
#include <stdio.h>
/**
 *  Prints system information on the stdout
 *
 *  name    utsname_test.c
 *  version 1.0
 *  author  Prof. Dr.-Ing. Damian Weber (dweber@htw-saarland.de)
 */
int main()
{
  struct utsname sysInfo;
  
  if(uname(&sysInfo) == 0)
  {
    puts("system information:");
    printf("sysname:  %s\n", sysInfo.sysname);
    printf("nodename: %s\n", sysInfo.nodename);
    printf("release:  %s\n", sysInfo.release);
    printf("version:  %s\n", sysInfo.version);
    printf("machine:  %s\n", sysInfo.machine);
  }
  else
  {
    // errno is already set
    perror("uname");
    return 1;
  }

  return 0;
}